<!DOCTYPE HTML>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<link rel="stylesheet" href="../css/currency/bootstrap.css" />
	<link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="../css/style.css" rel="stylesheet" type="text/css" />
	<link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="../css/recipe.css" />
	<title>APP管理</title>
</head>

<body>
<nav class="breadcrumb" style="margin-bottom:0px"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基础功能 <span class="c-gray en">&gt;</span>APP管理
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20" id="appInfo">
	<div class="text-c" id="appInfoList">
		<div class="cl pd-5 bg-1 bk-gray mt-20">
	            <span class="l mr-5">
	                <a class="btn btn-primary radius addFormula" id="addButton" @click="addOrUpdatePanel('add')">添加</a>
	            </span>
			<span class="r" v-cloak>
	            	共有数据：{{pageInfo.total}}条
	            </span>
		</div>
		<form >
			<table class="table table-border table-bordered table-bg" id="eqList">
				<thead>
				<tr class="text-c">
					<th nowrap="nowrap">app名称</th>
					<th nowrap="nowrap">版本号</th>
					<th nowrap="nowrap">上传日期</th>
					<th nowrap="nowrap">操作人</th>
					<th nowrap="nowrap">操作时间</th>
					<th nowrap="nowrap">广告/支付位置编号</th>
					<th nowrap="nowrap">广告/支付升级</th>
					<th nowrap="nowrap">过渡版本位置编号</th>
					<th nowrap="nowrap">过渡版本升级</th>
					<th nowrap="nowrap">固件APK版本编号</th>
					<th nowrap="nowrap">固件APK升级</th>
					<th nowrap="nowrap">操作</th>
				</tr>
				</thead>
				<tbody v-cloak >
				<!--<tr class="text-c" v-for="(item,index) in pageInfo.list" @click="showPostions(index)">-->
				<tr class="text-c" v-for="(item,index) in pageInfo.list" >
					<td nowrap="nowrap"><a :href="'../appInfo/download2?id=' + item.id" target="_blank" class="btn btn-link">{{item.appName}}</a></td>
					<td nowrap="nowrap">{{item.version}}</td>
					<td nowrap="nowrap">{{item.createTime}}</td>
					<td nowrap="nowrap">{{item.modifier}}</td>
					<td nowrap="nowrap">{{item.modifyTime}}</td>
					<td nowrap="nowrap">
						<span v-if="item.firmwareStatus=='1'">
							<select class="select"  disabled="true" style="color: #9da0a4">
								<option value="">广告/支付位置编号</option>
								<option v-for="app in item.appLists" :value="app">{{app}}</option>
							</select>
						</span>
						<span v-else-if="item.firmwareStatus!='1'">
							<select class="select">
								<option value="">广告/支付位置编号</option>
								<option v-for="app in item.appLists" :value="app">{{app}}</option>
							</select>
						</span>
					</td>
					<td nowrap="nowrap">
						<span v-if="item.firmwareStatus=='1'">
                                <a class="btn btn-primary radius" disabled="true">导入更新列表</a>
                                <a >
                                    <span class="btn btn-primary radius" disabled="true" v-if="item.updateStatus=='1'" >生效</span>
                                    <span class="btn btn-success radius" disabled="true" v-else>失效</span>
							    </a>
						</span>
						<span v-else-if="item.firmwareStatus!='1'">
                                <a class="btn btn-primary radius" @click="importUpdateVersion(index)" >导入更新列表</a>
                                <a @click="updateStatus1(index)" >
                                    <span class="btn btn-primary radius" v-if="item.updateStatus=='1'" >生效</span>
                                    <span class="btn btn-success radius" v-else>失效</span>
							    </a>
						</span>
					</td>
					<td nowrap="nowrap">
						<span v-if="item.firmwareStatus=='1'">
							<select class="select"  disabled="true" style="color: #9da0a4">
								<option value="">过渡版本位置编号</option>
								<option v-for="middle in item.middleLists" :value="middle">{{middle}}</option>
							</select>
						</span>
						<span v-else-if="item.firmwareStatus!='1'">
							<select class="select">
								<option value="">过渡版本位置编号</option>
								<option v-for="middle in item.middleLists" :value="middle">{{middle}}</option>
							</select>
						</span>
					</td>
					<td nowrap="nowrap">
                        <span v-if="item.firmwareStatus=='1'">
                                <a class="btn btn-primary radius"  disabled="true" >导入过渡版本列表</a>
                        </span>
                        <span v-else-if="item.firmwareStatus!='1'">
                                <a class="btn btn-primary radius" @click="importVersionList(index)" >导入过渡版本列表</a>
                        </span>
					</td>

					<td nowrap="nowrap">
						<span v-if="item.firmwareStatus!='1'">
							<select class="select"  disabled="true" style="color: #9da0a4">
								<option value="">固件APK版本编号</option>
								<option v-for="firmware in item.firmwareLists" :value="firmware">{{firmware}}</option>
							</select>
						</span>
						<span v-else-if="item.firmwareStatus=='1'">
							<select class="select">
								<option value="">固件APK版本编号</option>
								<option v-for="firmware in item.firmwareLists" :value="firmware">{{firmware}}</option>
							</select>
						</span>
					</td>
					<td nowrap="nowrap">
                        <span v-if="item.firmwareStatus!='1'">
                                <a class="btn btn-primary radius"  disabled="true">导入固件APK列表</a>
                        </span>
						<span v-else-if="item.firmwareStatus=='1'">
                                <a class="btn btn-primary radius" @click="importFirmwareList(index)" >导入固件APK列表</a>
                        </span>
					</td>
					<td nowrap="nowrap">
						<a  @click="deleteApp(index)" >
							<span class="btn btn-primary radius"  >删除</span>
						</a>
					</td>
				</tr>
				</tbody>
			</table>
		</form>

		<div class="pageBox" v-cloak id="pageBox" >
			<div class="pageInfo">显示 <span id="startRow">{{pageInfo.startRow}}</span> 到 <span id="endRow">{{pageInfo.endRow}}条</span>&nbsp;&nbsp;&nbsp;&nbsp;{{pageInfo.pages}}页&nbsp;&nbsp;&nbsp;&nbsp;共 <span id="total">{{pageInfo.total}}</span> 条
				<select v-model="selectedPageSize" v-on:change="getList('changePageSize')">
					<option value="5">5</option>
					<option value="10">10</option>
					<option value="15">15</option>
					<option value="20">20</option>
					<option value="50">50</option>
				</select>
			</div>
			<ul class="pagination" id="pagination"></ul>
		</div>
		<div class="tips"  id="noData" align="center" style="display: none">
			无数据
		</div>
	</div>

	<!--添加、更新弹窗-->
	<form class="form form-horizontal" id="addPanel" style="display: none" enctype="multipart/form-data" method="post">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="25%" align="right" nowrap="nowrap">

				</td>
				<td width="45%" style="margin-left: 0px">

				</td>

				<td width="30%" ></td>
			</tr>

			<tr id="t1">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>App文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="appFile"  placeholder="请上传App文件"  id="file"/>
				</td>

				<td  >
					<span class="Validform_checktip Validform_wrong errorInfo" v-if="appNameErr!=''">{{appNameErr}} </span>
					<span class="Validform_checktip Validform_wrong errorInfo" v-if="appVersionIdErr!=''">{{appVersionIdErr}} </span>
				</td>
			</tr>
			<tr id="t3">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						app名称：
					</label>
				</td>
				<td>
					<input type="text" class="input-text radius" :value="appName" readonly="readonly"/>
				</td>
				<td>
				</td>
			</tr>

			<tr id="t2">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>版本号：
					</label>
				</td>
				<td>
					<input type="text" class="input-text radius" name="version" v-model="version" placeholder="请填写版本号"/>
				</td>
				<td><span class="Validform_checktip Validform_wrong errorInfo" v-if="versionErr!=''">{{versionErr}} </span> </td>
			</tr>

			<tr id="t4">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>升级类型：
					</label>
				</td>
				<td>
				<span class="select-box" style="width:150px;">
                    <select id="firmwareStatus" class="select" v-model="firmwareStatus">
                        <option value="">-请选择升级类型-</option>
                        <option value="0">普通升级</option>
                        <option value="1">更新固件版本apk升级</option>
                    </select>
                </span>
				</td>
				<td><span class="Validform_checktip Validform_wrong errorInfo" v-if="firmwareStatusErr!=''">{{firmwareStatusErr}} </span> </td>
			</tr>
			<tr></tr><tr></tr>
			<tr>
				<td width="100%" class="text-r" colspan="2">
					<a class="btn btn-primary radius" style="margin-right: 100px;" id="saveDictType" @click="upload">保存</a>
					<a class="btn btn-default radius" id="addCancel" @click="cancel">取消</a>
				</td>
				<td width="40%" ></td>
			</tr>
		</table>
	</form>

	<div id="showPanel" style="display: none">
		<ul id="fold" class="Huifold provinces ml-50">
			<!--省-->
			<li class="item province  showA" v-for="(p,indexP) in provinces">
				<span class="inline">{{p.name}}</span>
				<ul class="Huifold">
					<!--//市-->
					<li class="item city showA" v-for="(c,indexC) in p.citys" style="padding-left: 20px;">
						<span>{{c.name}}</span>
						<ul class="Huifold">
							<!--//区-->
							<li class="item area showA" v-for="(a,indexA) in c.areas" style="padding-left: 20px;">
								<span>{{a.name}}</span>
								<ul class="Huifold">
									<div v-for='option in provinces[indexP].citys[indexC].areas[indexA].postions' style="padding-left: 20px;" class="showA">
										<span class="showSp">{{option.companyName}}:{{option.shopName}}</span>
									</div>
								</ul>
							</li>
						</ul>
					</li>
				</ul>

			</li>
		</ul>
	</div>

	<form class="form form-horizontal" id="importPanel" style="display: none" enctype="multipart/form-data" method="post">
		<input type="hidden" name="appVersionId" v-model="appVersionId">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="20%" align="right" nowrap="nowrap">
				</td>
				<td width="40%" style="margin-left: 0px">
				</td>
				<td width="40%"></td>
			</tr>
			<tr id="t12">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>位置数据文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="files"  placeholder="请选择导入的数据文件"  id="filed"/>
				</td>
				<td>
                        <span class="Validform_checktip Validform_wrong errorInfo" v-if="filedErr!=''">
                            {{filedErr}}
                        </span>
				</td>
			</tr>
			<tr>
				<td width="100%" class="text-r" colspan="3">
					<a class="btn btn-primary radius f-l ml-50 " style="width: 180px;" id="" @click="importB">保存</a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div class="f-l ml-50 errMsg error-msg" style="height: 70px;width: 500px" >
					</div>
				</td>
			</tr>
		</table>
	</form>

	<form class="form form-horizontal" id="importPanel1" style="display: none" enctype="multipart/form-data" method="post">
		<input type="hidden" name="appVersionId" v-model="appVersionId">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="20%" align="right" nowrap="nowrap">
				</td>
				<td width="40%" style="margin-left: 0px">
				</td>
				<td width="40%"></td>
			</tr>
			<tr id="t13">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>APP版本数据文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="files"  placeholder="请选择导入的数据文件"  id="filed1"/>
				</td>
				<td>
                        <span class="Validform_checktip Validform_wrong errorInfo" v-if="filedErr!=''">
                            {{filedErr}}
                        </span>
				</td>
			</tr>
			<tr>
				<td width="100%" class="text-r" colspan="3">
					<a class="btn btn-primary radius f-l ml-50 " style="width: 180px;" id=" "  @click="importA">保存</a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div class="f-l ml-50 errMsg error-msg" style="height: 70px;width: 500px" >
					</div>
				</td>
			</tr>
		</table>
	</form>


	<form class="form form-horizontal" id="importPanel2" style="display: none" enctype="multipart/form-data" method="post">
		<input type="hidden" name="appVersionId" v-model="appVersionId">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="20%" align="right" nowrap="nowrap">
				</td>
				<td width="40%" style="margin-left: 0px">
				</td>
				<td width="40%"></td>
			</tr>
			<tr id="t14">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>APP版本数据文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="files"  placeholder="请选择导入的数据文件"  id="filed2"/>
				</td>

				<td>
                        <span class="Validform_checktip Validform_wrong errorInfo" v-if="filedErr!=''">
                            {{filedErr}}
                        </span>
				</td>

			</tr>

			<tr>
				<td width="100%" class="text-r" colspan="3">
					<a class="btn btn-primary radius f-l ml-50 " style="width: 180px;" id="  "  @click="importC">保存</a>
				</td>
			</tr>

			<tr>
				<td colspan="3">
					<div class="f-l ml-50 errMsg error-msg" style="height: 70px;width: 500px" >
					</div>
				</td>
			</tr>
		</table>
	</form>

	<form class="form form-horizontal" id="importPanel3" style="display: none" enctype="multipart/form-data" method="post">
		<input type="hidden" name="appVersionId" v-model="appVersionId">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="20%" align="right" nowrap="nowrap">
				</td>
				<td width="40%" style="margin-left: 0px">
				</td>
				<td width="40%"></td>
			</tr>
			<tr id="t15">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>APP版本数据文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="files"  placeholder="请选择导入的数据文件"  id="filed3"/>
				</td>
				<td>
                        <span class="Validform_checktip Validform_wrong errorInfo" v-if="filedErr!=''">
                            {{filedErr}}
                        </span>
				</td>
			</tr>
			<tr>
				<td width="100%" class="text-r" colspan="3">
					<a class="btn btn-primary radius f-l ml-50 " style="width: 180px;" id="    "  @click="importD">保存</a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div class="f-l ml-50 errMsg error-msg" style="height: 70px;width: 500px" >
					</div>
				</td>
			</tr>
		</table>
	</form>

	<form class="form form-horizontal" id="importPanel4" style="display: none" enctype="multipart/form-data" method="post">
		<input type="hidden" name="appVersionId" v-model="appVersionId">
		<table class="table" border='0' width='100%'>
			<tr>
				<td width="20%" align="right" nowrap="nowrap">
				</td>
				<td width="40%" style="margin-left: 0px">
				</td>
				<td width="40%"></td>
			</tr>
			<tr id="t16">
				<td  align="right" nowrap="nowrap">
					<label class="form-label" style="padding:0px">
						<span class="c-red">*</span>APP版本数据文件：
					</label>
				</td>
				<td >
					<input type="file" class="input-text radius" name="files"  placeholder="请选择导入的数据文件"  id="filed4"/>
				</td>
				<td>
                        <span class="Validform_checktip Validform_wrong errorInfo" v-if="filedErr!=''">
                            {{filedErr}}
                        </span>
				</td>
			</tr>
			<tr>
				<td width="100%" class="text-r" colspan="3">
					<a class="btn btn-primary radius f-l ml-50 " style="width: 180px;" id="     "  @click="importE">保存</a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div class="f-l ml-50 errMsg error-msg" style="height: 70px;width: 500px" >
					</div>
				</td>
			</tr>
		</table>
	</form>


</div>
</body>

</html>
<script type="text/javascript" src="../js/common/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../lib/layer/1.9.3/layer.js" ></script>
<script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="../lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/common/H-ui.js"></script>
<script type="text/javascript" src="../js/common/H-ui.admin.js"></script>
<script type="text/javascript" src="../js/utils/utils.js"></script>
<script type="text/javascript" src="../js/currency/vue.js"></script>
<script type="text/javascript" src="../js/currency/vue-resource.min.js"></script>
<script type="text/javascript" src="../js/currency/base.js"></script>
<script type="text/javascript" src="../js/currency/jqPaginator.js"></script>
<script type="text/javascript" src="../js/appInfo.js"></script>

